<?php

namespace WebExpres\HotelBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class HotelBundle extends Bundle
{

    function check_email($email) { 
        
        if(preg_match('/^\w[-.\w]*@(\w[-._\w]*\.[a-zA-Z]{2,}.*)$/', $email, $matches)) 
        { 
            if(function_exists('checkdnsrr')) 
            { 
                if(checkdnsrr($matches[1] . '.', 'MX')) return true; 
                if(checkdnsrr($matches[1] . '.', 'A')) return true; 
            }else{ 
                if(!empty($hostName)) 
                { 
                    if( $recType == '' ) $recType = "MX"; 
                    exec("nslookup -type=$recType $hostName", $result); 
                    foreach ($result as $line) 
                    { 
                        if(eregi("^$hostName",$line)) 
                        { 
                            return true; 
                        } 
                    } 
                    return false; 
                } 
                return false; 
            } 
        } 
        
        return false;
        
    }
    
}
